<?php

namespace sil29\VitrineBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Commande
 */
class Commande
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var integer
     */
    private $statut;

    /**
     * @var \DateTime
     */
    private $dateCommande;

    /**
     * @var string
     */
    private $infoSupp;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $lignesCommande;

    /**
     * @var \sil29\VitrineBundle\Entity\User
     */
    private $user;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->lignesCommande = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set statut
     *
     * @param integer $statut
     * @return Commande
     */
    public function setStatut($statut)
    {
        $this->statut = $statut;

        return $this;
    }

    /**
     * Get statut
     *
     * @return integer 
     */
    public function getStatut()
    {
        return $this->statut;
    }

    /**
     * Get statut label
     *
     * @return string
     */
    public function getStatutLabel()
    {
    	if ($this->statut == 0) {
    		return 'En Attente';
    	} else if ($this->statut == 1) {
    		return 'En Preparation';
    	} else if ($this->statut == 2) {
    		return 'En Livraison';
    	} else if ($this->statut == 3) {
    		return 'Livrée';
    	}  else if ($this->statut == 4) {
    		return 'Refusée';
    	}
    }
    
    public function getStatutPastilla() {
    	if ($this->statut == 0) {
    		return '';
    	} else if ($this->statut == 1) {
    		return 'label-info';
    	} else if ($this->statut == 2) {
    		return 'label-warning';
    	} else if ($this->statut == 3) {
    		return 'label-success';
    	}  else if ($this->statut == 4) {
    		return 'label-important';
    	}
    }
    
    /**
     * Set dateCommande
     *
     * @param \DateTime $dateCommande
     * @return Commande
     */
    public function setDateCommande($dateCommande)
    {
        $this->dateCommande = $dateCommande;

        return $this;
    }

    /**
     * Get dateCommande
     *
     * @return \DateTime 
     */
    public function getDateCommande()
    {
        return $this->dateCommande;
    }

    /**
     * Set infoSupp
     *
     * @param string $infoSupp
     * @return Commande
     */
    public function setInfoSupp($infoSupp)
    {
        $this->infoSupp = $infoSupp;

        return $this;
    }

    /**
     * Get infoSupp
     *
     * @return string 
     */
    public function getInfoSupp()
    {
        return $this->infoSupp;
    }

    /**
     * Add lignesCommande
     *
     * @param \sil29\VitrineBundle\Entity\LigneCommande $lignesCommande
     * @return Commande
     */
    public function addLignesCommande(\sil29\VitrineBundle\Entity\LigneCommande $lignesCommande)
    {
        $this->lignesCommande[] = $lignesCommande;

        return $this;
    }

    /**
     * Remove lignesCommande
     *
     * @param \sil29\VitrineBundle\Entity\LigneCommande $lignesCommande
     */
    public function removeLignesCommande(\sil29\VitrineBundle\Entity\LigneCommande $lignesCommande)
    {
        $this->lignesCommande->removeElement($lignesCommande);
    }

    /**
     * Get lignesCommande
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getLignesCommande()
    {
        return $this->lignesCommande;
    }

    /**
     * Set user
     *
     * @param \sil29\VitrineBundle\Entity\User $user
     * @return Commande
     */
    public function setUser(\sil29\VitrineBundle\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \sil29\VitrineBundle\Entity\User 
     */
    public function getUser()
    {
        return $this->user;
    }
    
    public function __toString(){
    	return $this->id;
    }
}
